package com.itheima.Jiuye11;

import java.io.File;

public class Test02 {
    public static void main(String[] args) {
        File file = new File("C:\\Users\\纹龍\\Desktop\\ttic");
        deleteDir(file);
    }

    private static void deleteDir(File file) {
        File[] files = file.listFiles();
        if (files != null){
            for (File file1 : files) {
                if (file1.isFile()){
                    file1.delete();
                }else {
                    deleteDir(file1);
                }
                file1.delete();
            }
        }
            file.delete();
    }


}
